1. Field of the Invention
The patent or application file contains at least one drawing executed in color. Copies of this patent or patentg application publication with color drawing (s) will be provided by the Office upon request and payment of the necessary fee.
The present invention generally relates to computer graphics. More particularly, the present invention relates to a method of processing diverse graphic objects that are rendered visually three-dimensional (3D) by relation map function.
2. Description of the Related Art
The growing popularity of computers has enabled conventional film clips, graphics and pictures to be digitized for computer processing, allowing special visual effects never before possible. Computer imaging or graphing is also gaining a foothold in almost every profession because of the widespread use of computers. However, the restricted features of the video display and the computer have made typical computer applications more suitable for processing 2-D graphic objects and for presenting 2-D effects rather than for processing 3-D graphic objects and presenting 3-D effects.
The conventional method for achieving 3-D effect uses the polygonal approach. In said polygonal approach, a 2-D planar graphics is first determined and segmented into a plurality of polygons with computer operations. Then an interpolation operation is performed to change the associated color value of the pixels of each polygon to render 3-D visual effects. Generally speaking, the 2-D original graphic is usually composed of smooth curves of polynomials and the smooth and gradual visual effect is usually desired. Whereas, the effect of conventional method using plural polygons to change the color values of the pixels is not so satisfactory. For example, if not enough polygons applied, the zigzag distortion will happen on the lines corresponding to the curves of the 2-D original graphic. Thus, the visual effect is adversely affected.
In another way, if the applied polygons are increased to avoid the above-mentioned problem, the processing time will be considerably increased. Additionally, if different kinds of visual effects are desired on a 2-D original graphic, every corresponding segmenting way may be accordingly different and the processing time can be also increased.
Another processing method of rendering 3-D graphic effects with a 2-D graphic object is disclosed in the U.S. Pat. No. 5,828,380 assigned to Ulead Systems, Inc. In said processing method, a relation map function is first given for each pixel of the graphic to obtain the directional relation of the corresponding 2-D graphic object. The required 3-D imaging effects, such as generating the measurement of length corresponding to the third axis (i e., z-axis), can be generated from the acquired directional-relation through an effect function to actualize 3-D visual effects.
FIG. 1 is a diagram illustrating the relation map function of the prior art. For example, a 2-D graphic object is a ring-shape area confined by an outer curve 40 and an inner curve 41. In the drawing, the graphic object is composed of numerous pixels, such as A1, A2, and A3. In said processing method, a relation map function corresponding to pixels of the 2-D original graphics is first obtained, which represents a distance or a vector from every pixel to the corresponding edge of the curves 40 or 41 located closest thereto. In FIG. 1, the relation map function represents the directional relation of the vectors from every pixel to the edges located closest thereto, such as V1, V2, and V3.
Then, an effect function is used to render the 2-D graphic object visually three-dimensional. As to the effect function, a relation limit dmax and a predetermined contour curve should be defined. Only those pixels within the range of the distance dmax from the edge of the 2-D graphic object are subjected to 3-D processing such as effect on relation map (ERM) functions, whereas the z-axis coordinate of each pixel within that range can be determined by the predetermined contour curve, accordingly.
FIGS. 2a-2c illustrate three possible contour curves in accordance with the effect function. FIG. 2a is a type of rounded bevel, with C1 denoting a contour curve, and the coordinate of the pixel (x,y) starting from the edge within a relation limit dmax determines the corresponding coordinate on the axis z in accordance with said contour curve C1. Further, FIG. 2b is a type of straight bevel, with C2 denoting a contour curve; and FIG. 2c a combined type of two rounded bevels, with C3 denoting a contour curve.
Taking the rounded bevel type of FIG. 2a as an example, assume the distance from the coordinate of the pixel (x,y) to the edge of the corresponding edge is L(=√{square root over (x2+y2)}); then the z-axis parameters of said pixel (x,y) can be determined as follows:z=L×tan[cos−1((dmax−L)/dmax)]  (1)
The computations of z-axis parameters under other circumstances can also be made in a similar manner. In other words, the z-axis coordinate corresponding to each pixel within the relation limit dmax in the above contour curves can be calculated with mathematical equations.
Though the conventional effect function may rapidly render visually 3-D effects with quite simple operations processing, its application still demonstrates some inadequacies. First, it is restricted by the inflexibility of the relation limit dmax in that the portion to be 3-D mapped can only be displayed in a symmetrical pattern. Referring to FIG. 3, wherein the outer curve defines the area of a 2-D graphic object, the portion to be 3-D mapped is within the range 0 to dmax. FIGS. 4a-4c are diagrams illustrating a stereograph of a 3-D graphic object of FIG. 3 processed with rounded bevel, straight bevel and two-rounded bevels, respectively. As observed from FIGS. 4a-4c, the rendered stereographs are definitely in symmetrical curves. However, even some 3-D model objects (such as pyramids or cones) with a particular symmetrical pattern will show unsymmetrical visual effects when observed from various perspectives. The conventional method can not realize such asymmetrical visual effect.
Second, all the contour curves, such as rounded bevel, straight bevel, two-rounded bevels as shown in FIGS. 2a-2c must be expressed by mathematics formula, and therefore fail to demonstrate a variety of sterographs because of the limited variations of the rigid contour curves and their identical orientations. In summary, the effect function as adopted in the prior art encounters difficulty in rendering diversified graphics.